package module.building.model.dataObj
{
	/**
	 * 订单数据类，包含了一份订单的各个信息 
	 * @author hc
	 */
	public class OrderObj
	{
		/**
		 * 生产ID 
		 */
		public var serverId:String
		
		/**
		 * 订单类别：food是粮食，reserverduty是兵力，gold是金币
		 */
		public var type:String;
		
		/**
		 * 生产名称 
		 */
		public var name:String;
		
		/**
		 * 生产时间 
		 */
		public var time:int;
		
		/**
		 * 产量 
		 */
		public var output:int;
		
		/**
		 * 消耗金币 
		 */
		public var gold:int;
		
		/**
		 * 载体建筑ID 
		 */
		public var buildingID:String;
		
		/**
		 * 订单开始的时间 
		 */
		public var startTime:Date;
		/**
		 *订单获得经验 
		 */		
		public var experience:int;
		
		public function OrderObj()
		{
		}
		
		public static function parseData(obj:Object):OrderObj
		{
			var returnObj:OrderObj = new OrderObj();
			returnObj.serverId = obj.serverId;
			returnObj.type = obj.type;
			returnObj.name = obj.name;
			returnObj.time = obj.time;
			returnObj.output = obj.output;
			returnObj.gold = obj.gold;
			returnObj.buildingID = obj.buildingID;
			//returnObj.experience = obj.experience;
			
			return returnObj;
		}
		
		public function clone():OrderObj
		{
			var returnObj:OrderObj = new OrderObj();
			returnObj.serverId = this.serverId;
			returnObj.type = this.type;
			returnObj.name = this.name;
			returnObj.time = this.time;
			returnObj.output = this.output;
			returnObj.gold = this.gold;
			returnObj.buildingID = this.buildingID;
			//returnObj.experience = this.experience;
			
			return returnObj;
		}
	}
}